﻿using System;
using Hopscotch.Presentation.Common;
using Microsoft.Practices.Prism.Modularity;
using Microsoft.Practices.Prism.Regions;
using Microsoft.Practices.ServiceLocation;
using Microsoft.Practices.Unity;
using Hopscotch.Presentation.EnquiryModule.Views;
using Hopscotch.Presentation.EnquiryModule.Constants;
using Hopscotch.Presentation.Common.Utils;


namespace Hopscotch.Presentation.EnquiryModule
{
    public class Module : IModule
    {
		private readonly IAppController shellController;

		public Module(IAppController shellController)
        {
			this.shellController = shellController;
        }

        public void Initialize()
        {
			var container = ServiceLocator.Current.GetInstance<IUnityContainer>();
						
			var uri = ResourceHelper.GetIconUri(this.GetType().Assembly, IconPaths.Enquiry16);
			shellController.RegisterTool("Enquiry", typeof(EnquiryView), uri);
						
			// Register other view objects with DI Container (Unity)
			container.RegisterType<Object, EnquiryView>(typeof(EnquiryView).Name);			
        }
		
    }
}
